// Package wire
/**
* @Project : geektime-basic-go-study
* @File    : db.go
* @IDE     : GoLand
* @Author  : Tvux
* @Date    : 2024/10/7 21:03
**/

package wire

import (
	"geektime-basic-go-study/webook/backend/config"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func InitDB() *gorm.DB {
	db, err := gorm.Open(mysql.Open(config.Config.DBConf.DSN))
	if err != nil {
		panic(err)
	}
	return db
}
